home *** CD-ROM | disk | FTP | other *** search
/ Space & Astronomy / Space and Astronomy (October 1993).iso / pc / programs / mac / almanac.sit / Almanac v1.8 / card_9537.txt < prev    next >
Text File  |  1990-04-21  |  3KB  |  146 lines

  1. -- card: 9537 from stack: in.8
  2. -- bmap block id: 10919
  3. -- flags: 0000
  4. -- background id: 6859
  5. -- name: Conjunct
  6. ----- HyperTalk script -----
  7. on openCard
  8.   put line 1 of cd fld date into line 2 of cd fld date
  9.   put the date into line 1 of cd fld date
  10.   if line 1 of cd fld date Γëá line 2 of cd fld date then conj
  11.   pass openCard
  12. end openCard
  13.  
  14. on conj
  15.   hide message box
  16.   global ra,dec,planet
  17.   put empty into ra
  18.   put empty into dec
  19.   put "Moon,Mercury,Venus,Mars,Jupiter,Saturn,Uranus,Neptune" into planet
  20.   put 2 into c1
  21.   put cd fld threshhold into thresh
  22.   put 0 into k
  23.   put empty into cd fld conj
  24.   put c1+8 into c2
  25.   put c1 into j
  26.   repeat with i=c1 to c2
  27.     set cursor to busy
  28.     if i=3 then next repeat
  29.     put line 5 of fld Pos of cd i into item j-c1+1 of ra
  30.     put line 6 of fld Pos of cd i into item j-c1+1 of dec
  31.     add 1 to j
  32.   end repeat
  33.   put number of items of ra into nra
  34.   repeat with i=1 to nra-1
  35.     repeat with j=i+1 to nra
  36.       get sqrt((item i of ra - item j of ra)^2+ (item i of dec - item j of dec)^2)
  37.       if it<thresh then
  38.         if it<1 then get trunc(it*100)/100
  39.         else
  40.           get trunc(it*10)/10
  41.         end if
  42.         add 1 to k
  43.         set numberFormat to "0.0#"
  44.         put item i of planet &&"and"&& item j of planet && "will be" &&"separated by "&&it&&"degrees." into line k of cd fld conj
  45.         set numberFormat to "0.######"
  46.       end if
  47.       set cursor to busy
  48.     end repeat
  49.   end repeat
  50.   ftype "conj",12
  51. end conj
  52.  
  53. on enterInField
  54.   conj
  55. end enterInField
  56.  
  57. on returnInField
  58.   conj
  59. end returnInField
  60.  
  61.  
  62.  
  63. -- part 1 (field)
  64. -- low flags: 00
  65. -- high flags: 0000
  66. -- rect: left=356 top=299 right=323 bottom=448
  67. -- title width / last selected line: 0
  68. -- icon id / first selected line: 0 / 0
  69. -- text alignment: 0
  70. -- font id: 15026
  71. -- text size: 18
  72. -- style flags: 0
  73. -- line height: 24
  74. -- part name: Date
  75.  
  76.  
  77. -- part 6 (field)
  78. -- low flags: 02
  79. -- high flags: 0000
  80. -- rect: left=361 top=49 right=68 bottom=395
  81. -- title width / last selected line: 0
  82. -- icon id / first selected line: 0 / 0
  83. -- text alignment: 1
  84. -- font id: 15032
  85. -- text size: 14
  86. -- style flags: 256
  87. -- line height: 18
  88. -- part name: Threshhold
  89.  
  90.  
  91. -- part 3 (field)
  92. -- low flags: 00
  93. -- high flags: 0002
  94. -- rect: left=29 top=77 right=297 bottom=457
  95. -- title width / last selected line: 0
  96. -- icon id / first selected line: 0 / 0
  97. -- text alignment: 0
  98. -- font id: 15032
  99. -- text size: 14
  100. -- style flags: 256
  101. -- line height: 18
  102. -- part name: conj
  103.  
  104.  
  105. -- part 16 (button)
  106. -- low flags: 00
  107. -- high flags: 0004
  108. -- rect: left=471 top=148 right=185 bottom=508
  109. -- title width / last selected line: 0
  110. -- icon id / first selected line: 26516 / 26516
  111. -- text alignment: 1
  112. -- font id: 0
  113. -- text size: 12
  114. -- style flags: 0
  115. -- line height: 16
  116. -- part name: conj
  117. ----- HyperTalk script -----
  118. on mouseUp
  119.   conj
  120. end mouseUp
  121.  
  122.  
  123.  
  124. -- part contents for card part 1
  125. ----- text -----
  126. 4/21/90
  127. 4/11/90
  128.  
  129. -- part contents for background part 11
  130. ----- text -----
  131. Sidereal Time = 5:21
  132. 5.358495
  133.  
  134. -- part contents for background part 12
  135. ----- text -----
  136. Universal Time = 20:58
  137. 20.97
  138.  
  139. -- part contents for card part 6
  140. ----- text -----
  141. 10
  142.  
  143. -- part contents for card part 3
  144. ----- text -----
  145. Moon and Venus will be separated by  3.4 degrees.
  146. Uranus and Neptune will be separated by  5.5 degrees.